Tool Result Output
Structured return type for Tool.toModelOutput. Replaces the flat String return per historical parity gap #14. Lets a tool supply EITHER a short plain-text summary OR a structured JSON payload OR a typed error to the model — the agent's loop bridges each into the wire-format ContentPart.ToolResult.modelVisible appropriately:
Text →
JsonPrimitive(text),isError = false.Json → the JsonElement as-is,
isError = false.Content → a list of model-visible content parts,
isError = content.isError.Error →
JsonPrimitive("Error: $message"),isError = true.
Inheritors
Types
Link copied to clipboard
@Serializable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard